Integrand size = 29, antiderivative size = 551 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\frac {b^2 e^2 n^2 \log (x)}{d^2 f}-\frac {b e n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f x}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 f^2}-\frac {b e^2 n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (1-\frac {d}{d+e x}\right )}{d^2 f}+\frac {b^2 e^2 n^2 \operatorname {PolyLog}\left (2,\frac {d}{d+e x}\right )}{d^2 f}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{f^2}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,1+\frac {e x}{d}\right )}{f^2}-\frac {b^2 g n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}-\frac {b^2 g n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{f^2}+\frac {2 b^2 g n^2 \operatorname {PolyLog}\left (3,1+\frac {e x}{d}\right )}{f^2} \]
[Out]
Time = 0.63 (sec) , antiderivative size = 551, normalized size of antiderivative = 1.00, number of steps used = 23, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.414, Rules used = {2463, 2445, 2458, 2389, 2379, 2438, 2351, 31, 2443, 2481, 2421, 6724} \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=-\frac {b e^2 n \log \left (1-\frac {d}{d+e x}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f}-\frac {b e n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f x}+\frac {b g n \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{f^2}+\frac {b g n \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{f^2}-\frac {2 b g n \operatorname {PolyLog}\left (2,\frac {e x}{d}+1\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{f^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{d \sqrt {g}+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f^2}+\frac {g \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f^2}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}+\frac {b^2 e^2 n^2 \operatorname {PolyLog}\left (2,\frac {d}{d+e x}\right )}{d^2 f}+\frac {b^2 e^2 n^2 \log (x)}{d^2 f}-\frac {b^2 g n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}-\frac {b^2 g n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right )}{f^2}+\frac {2 b^2 g n^2 \operatorname {PolyLog}\left (3,\frac {e x}{d}+1\right )}{f^2} \]
[In]
[Out]
Rule 31
Rule 2351
Rule 2379
Rule 2389
Rule 2421
Rule 2438
Rule 2443
Rule 2445
Rule 2458
Rule 2463
Rule 2481
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f x^3}-\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2 x}+\frac {g^2 x \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2 \left (f+g x^2\right )}\right ) \, dx \\ & = \frac {\int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3} \, dx}{f}-\frac {g \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x} \, dx}{f^2}+\frac {g^2 \int \frac {x \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx}{f^2} \\ & = -\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g^2 \int \left (-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {g} \left (\sqrt {-f}-\sqrt {g} x\right )}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {g} \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx}{f^2}+\frac {(b e n) \int \frac {a+b \log \left (c (d+e x)^n\right )}{x^2 (d+e x)} \, dx}{f}+\frac {(2 b e g n) \int \frac {\log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx}{f^2} \\ & = -\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}-\frac {g^{3/2} \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}-\sqrt {g} x} \, dx}{2 f^2}+\frac {g^{3/2} \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}+\sqrt {g} x} \, dx}{2 f^2}+\frac {(b n) \text {Subst}\left (\int \frac {a+b \log \left (c x^n\right )}{x \left (-\frac {d}{e}+\frac {x}{e}\right )^2} \, dx,x,d+e x\right )}{f}+\frac {(2 b g n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (-\frac {e \left (-\frac {d}{e}+\frac {x}{e}\right )}{d}\right )}{x} \, dx,x,d+e x\right )}{f^2} \\ & = -\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 f^2}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (1+\frac {e x}{d}\right )}{f^2}+\frac {(b n) \text {Subst}\left (\int \frac {a+b \log \left (c x^n\right )}{\left (-\frac {d}{e}+\frac {x}{e}\right )^2} \, dx,x,d+e x\right )}{d f}-\frac {(b e n) \text {Subst}\left (\int \frac {a+b \log \left (c x^n\right )}{x \left (-\frac {d}{e}+\frac {x}{e}\right )} \, dx,x,d+e x\right )}{d f}-\frac {(b e g n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{d+e x} \, dx}{f^2}-\frac {(b e g n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{d+e x} \, dx}{f^2}+\frac {\left (2 b^2 g n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {x}{d}\right )}{x} \, dx,x,d+e x\right )}{f^2} \\ & = -\frac {b e n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f x}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 f^2}-\frac {b e^2 n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (1-\frac {d}{d+e x}\right )}{d^2 f}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (1+\frac {e x}{d}\right )}{f^2}+\frac {2 b^2 g n^2 \text {Li}_3\left (1+\frac {e x}{d}\right )}{f^2}-\frac {(b g n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}+d \sqrt {g}}{e}-\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{f^2}-\frac {(b g n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}-d \sqrt {g}}{e}+\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{f^2}+\frac {\left (b^2 e n^2\right ) \text {Subst}\left (\int \frac {1}{-\frac {d}{e}+\frac {x}{e}} \, dx,x,d+e x\right )}{d^2 f}+\frac {\left (b^2 e^2 n^2\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {d}{x}\right )}{x} \, dx,x,d+e x\right )}{d^2 f} \\ & = \frac {b^2 e^2 n^2 \log (x)}{d^2 f}-\frac {b e n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f x}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 f^2}-\frac {b e^2 n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (1-\frac {d}{d+e x}\right )}{d^2 f}+\frac {b^2 e^2 n^2 \text {Li}_2\left (\frac {d}{d+e x}\right )}{d^2 f}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{f^2}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (1+\frac {e x}{d}\right )}{f^2}+\frac {2 b^2 g n^2 \text {Li}_3\left (1+\frac {e x}{d}\right )}{f^2}-\frac {\left (b^2 g n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {\sqrt {g} x}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{f^2}-\frac {\left (b^2 g n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {\sqrt {g} x}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{f^2} \\ & = \frac {b^2 e^2 n^2 \log (x)}{d^2 f}-\frac {b e n (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )}{d^2 f x}-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 f x^2}-\frac {g \log \left (-\frac {e x}{d}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 f^2}+\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 f^2}-\frac {b e^2 n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (1-\frac {d}{d+e x}\right )}{d^2 f}+\frac {b^2 e^2 n^2 \text {Li}_2\left (\frac {d}{d+e x}\right )}{d^2 f}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}+\frac {b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{f^2}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (1+\frac {e x}{d}\right )}{f^2}-\frac {b^2 g n^2 \text {Li}_3\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{f^2}-\frac {b^2 g n^2 \text {Li}_3\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{f^2}+\frac {2 b^2 g n^2 \text {Li}_3\left (1+\frac {e x}{d}\right )}{f^2} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.35 (sec) , antiderivative size = 811, normalized size of antiderivative = 1.47 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\frac {-d^2 f \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2-2 d^2 g x^2 \log (x) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2+d^2 g x^2 \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (f+g x^2\right )-2 b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (f \left (d e x+e^2 x^2 \log (x)+\left (d^2-e^2 x^2\right ) \log (d+e x)\right )-d^2 g x^2 \left (\log (d+e x) \log \left (\frac {e \left (\sqrt {f}+i \sqrt {g} x\right )}{e \sqrt {f}-i d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,-\frac {i \sqrt {g} (d+e x)}{e \sqrt {f}-i d \sqrt {g}}\right )\right )-d^2 g x^2 \left (\log (d+e x) \log \left (\frac {e \left (\sqrt {f}-i \sqrt {g} x\right )}{e \sqrt {f}+i d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {i \sqrt {g} (d+e x)}{e \sqrt {f}+i d \sqrt {g}}\right )\right )+2 d^2 g x^2 \left (\log \left (-\frac {e x}{d}\right ) \log (d+e x)+\operatorname {PolyLog}\left (2,1+\frac {e x}{d}\right )\right )\right )+b^2 n^2 \left (f \left (2 e^2 x^2 \log (x)-\log (d+e x) \left (2 e^2 x^2 \log \left (-\frac {e x}{d}\right )+(d+e x) (2 e x+(d-e x) \log (d+e x))\right )-2 e^2 x^2 \operatorname {PolyLog}\left (2,1+\frac {e x}{d}\right )\right )+d^2 g x^2 \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )\right )+d^2 g x^2 \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )-2 d^2 g x^2 \left (\log \left (-\frac {e x}{d}\right ) \log ^2(d+e x)+2 \log (d+e x) \operatorname {PolyLog}\left (2,1+\frac {e x}{d}\right )-2 \operatorname {PolyLog}\left (3,1+\frac {e x}{d}\right )\right )\right )}{2 d^2 f^2 x^2} \]
[In]
[Out]
\[\int \frac {{\left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{x^{3} \left (g \,x^{2}+f \right )}d x\]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )} x^{3}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )} x^{3}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2}}{{\left (g x^{2} + f\right )} x^{3}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{x^3 \left (f+g x^2\right )} \, dx=\int \frac {{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{x^3\,\left (g\,x^2+f\right )} \,d x \]
[In]
[Out]